package com.distributer.delayqueue.delayqueue.support;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix=RedisQueueProperties.REDIS_QUEUE_PREFIX)
public class RedisQueueProperties {

	protected static final String REDIS_QUEUE_PREFIX = "delay.queue";
	
	private String name = "queue";
	private String profix = "delay.queue";
	private String originPool = "pools";
	private String readyName = "ready";
	private int bucketSize = 3;
	private long bucketRoundRobinTime =300;
	private long readyRoundRobindTime = 200;
	private boolean cluster = false;
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getProfix() {
		return profix;
	}
	public void setProfix(String profix) {
		this.profix = profix;
	}
	public String getOriginPool() {
		return originPool;
	}
	public void setOriginPool(String originPool) {
		this.originPool = originPool;
	}
	public String getReadyName() {
		return readyName;
	}
	public void setReadyName(String readyName) {
		this.readyName = readyName;
	}
	public int getBucketSize() {
		return bucketSize;
	}
	public void setBucketSize(int bucketSize) {
		this.bucketSize = bucketSize;
	}
	public long getBucketRoundRobinTime() {
		if (bucketRoundRobinTime <= 0) {
			this.bucketRoundRobinTime = 300;
		}
		return bucketRoundRobinTime;
	}
	public void setBucketRoundRobinTime(long bucketRoundRobinTime) {
		this.bucketRoundRobinTime = bucketRoundRobinTime;
	}
	public long getReadyRoundRobindTime() {
		if (this.readyRoundRobindTime <=0) {
			this.readyRoundRobindTime = 200;
		}
		return readyRoundRobindTime;
	}
	public void setReadyRoundRobindTime(long readyRoundRobindTime) {
		this.readyRoundRobindTime = readyRoundRobindTime;
	}
	public boolean isCluster() {
		return cluster;
	}
	public void setCluster(boolean cluster) {
		this.cluster = cluster;
	}
	
}
